package Pattern.FactoryPattern.Car;



/**
 * @Author MJS
 * @Date 2021/8/4 11:33
 * @Description
 */
public class BMWFactory extends AbstractFactory {
    public Car getCar(String type) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class<?> cl = Class.forName(type);
        return (BMWCar)cl.newInstance();
    }
}
